package core

class Person {
	String firstName
	String lastName
	Date birthDate
//	String fullName
	// gender 
	// maritalStatus
	// 
	
	String toString() {
		firstName + ' ' + lastName + ' ' + birthDate.format('yy-MM-dd')
	}
	
	static hasMany = [legalIdentifiers: LegalIdentifier, nationalities: Nationality, personAddresses: PersonAddress]
	
    static constraints = {
    }
	
	static transients = ['age']
	
	int getAge() {
		(new Date() - birthDate)/365.25
	}
	
//	static mapping = {
//		tablePerHierarchy false
//	}

}

